<!--
 * @Descripttion:
 * @version:
 * @Author: jiating
 * @Date: 2021-02-22 17:03:48
 * @LastEditors: jiating
 * @LastEditTime: 2021-02-24 14:59:55
-->
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>K5G-C</title>
    <link rel="stylesheet" href="./css/common.css"/>
    <link rel="stylesheet" href="./css/index.css"/>
    <link rel="stylesheet" href="./css/reboot.css"/>
</head>

<body>
<div class="main">
    <div class="tit-heade">
        <div class="itemOne">
            <img src="./image/left.png" >
        </div>
        <div class="itemTwo">
            <div class="item-chil">
                <img src="./image/logoutOne.png">
            </div>
            <div class="item-chil">
                <a href="/action/logout">ログアウト</a>
            </div>
            
        </div>
    </div>
    <div class="nav2">
        <div class="nav-item">
            <div id='x1' class="item" onclick="toPage('./home.html')">ホーム</div>
        </div>
        <div class="nav-item">
            <div id='x2' class="item no-act" onclick="toPage('./mobileData.html')">モバイルネットワーク</div>
        </div>
        <div class="nav-item">
            <div id='x3' class="item no-act" onclick="toPage('./wifi.html')">Wi-Fi設定</div>
            <div class="hide">
                <div>
                    <div id='x31' class="item1 no-act">wifi設定</div>
                    <div class="hide">
                        <div class="item2" id="wifi1" onclick="toPage('./wifi.html')">Wi-Fi</div>
                        <div class="item2" id="wifi2" onclick="toPage('./wifiList.html')">Wi-Fi 接続情報</div>
                        <div class="item2" id="wifi_list" onclick="toPage('./wifiManage.html')">接続デバイスの管理</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="nav-item">
            <div id='x4' class="item no-act" onclick="toPage('./dhcp.html')">Ethernet設定</div>
            <div class="hide">
                <div>
                    <div id='x41' class="item1 no-act">DHCP固定割当設定</div>
                    <div class="">
                        <div class="item2" id="DHCP">DHCP固定割当設定</div>
                        <div class="item2" id="MAC">MAC IP Bindingリスト</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="nav-item">
            <div id='x5' class="item no-act" onclick="toPage('./port.html')">LAN設定</div>
            <div class="hide">
                <div>
                    <div id='x51' class="item no-act">ポートフォワーディング</div>
                    <div class="hide">
                        <div class="item2" id="port">ポートフォワーディング</div>
                        <div class="item2" id="port_list">ポートフォワーディングリスト</div>
                    </div>
                </div>
                <div>
                    <div id='x52' class="item1 no-act">IPパケットフィルタリング</div>
                    <div class="hide">
                        <div class="item2" id="IP">IPパケットフィルタリング</div>
                        <div class="item2" id="IP_list">IPパケットフィルタリングリスト</div>
                    </div>
                </div>
                <div>
                    <div id='x53' class="item1 no-act"
                         onclick="toPage('./dmz.html')">
                        DMZ
                    </div>
                </div>
                <div>
                    <div id='x54' class="item1 no-act">IPV6パケットフィルタリング</div>
                    <div class="hide">
                        <div class="item2" id="IPV6">IPV6パケットフィルタリング</div>
                        <div class="item2" id="IPV6_list">IPV6パケットフィルタリングリスト</div>
                    </div>
                </div>
                <div>
                    <div id='x55' class="item1 no-act"
                         onclick="toPage('./dmz.html')">
                        WANポートPingブロック</div>
                </div>
            </div>
        </div>
        <div class="nav-itm">
            <div id='x6' class="item no-act" onclick="toPage('./password.html')">端末設定</div>
            <div class="">
                <div>
                    <div class="">
                        <div class="item1" onclick="toPage('./password.html')">パスワード変更</div>
                        <div class="item1" onclick="toPage('./dataTrafficSetting.html')">データ通信量設定</div>
                        <div class="item1" onclick="toPage('./offlineUpdate.html')">ソフトウェア更新</div>
                        <div class="item1 choose" onclick="toPage('./reboot.html')">リセット</div>
                        <div class="item1" onclick="toPage('./deviceInformation.html')">デバイス情報</div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="mobile" class="content">
        <div class="title">リセット</div>
        <div class="form-box" style="padding: 30px">
            <div style="color: #333333; font:bold; font-size: 24px; border-bottom: 1px solid #000">再起動
            </div>
        </div>
        <div style="margin-left: 100px;">
            端末を再起動します。
        </div>
        <form action="" class="default-form">
            <table class="input-table">
                <tbody>
                <tr>
                    <th><label class="default-label" for="">再起動</label></th>
                    <td>
                        <div onclick="startAp()" id="save-wifi1" class="submit-btn">実行</div>
<!--                        <input type="checkbox" onclick="startAp()" name="roaming" id="roaming" class="chooseBtn"/>-->
<!--                        <label for="roaming" class="choose-label"/>-->
                    </td>
                </tr>
                </tbody>
            </table>
        </form>

        <div class="form-box" style="padding: 30px">
            <div style="color: #333333; font:bold; font-size: 24px; border-bottom: 1px solid #000">出荷時リセット
            </div>
        </div>
        <div style="margin-left: 100px;margin-bottom: 10px;">
            すべてのデータを消去し、工場出荷時状態に戻します。
        </div>
        <form action="" class="default-form">
        <table class="input-table">
            <tbody>
            <tr>
                <th><label class="default-label" for="">出荷時リセット</label></th>
                <td>
                    <div onclick="rebootBtn()" id="save-wifi" class="submit-btn">実行</div>
                </td>
            </tr>

            </tbody>
        </table>
        </form>

    </div>
    <div id="rebootBtn" >
        <div class="win">
            <!--<p>我是弹框中的内容</p>-->
            <div class="search">

            </div>
            <div class="tab-data">
                実行してもよろしいですか？
            </div>
            <div class="btn">
                <button onclick="btnOne()" class="btnOne">はい</button>
                <button onclick="closeframe()" class="btnOne">いいえ</button>
            </div>
            　　<span class="close" onclick="closeframe()">×</span>
        </div>
    </div>

</div>

<script type="text/javascript" src="./js/utils.js"></script>
<script>
    var type = ''
    window.onload = function () {
        getSimNum()
    }

    function getSimNum() {
        var num = sessionStorage.getItem('activeSimNumber')
        if (num == 0) {
            var btn = document.getElementById('x2')
            btn.onclick = function() {}
            btn.style.backgroundColor = '#eee'
        }
        var params = {}
        Ajax.post(baseUrl + '/action/getActiveSimCardNumber', JSON.stringify(params), function(res) {
            var response = JSON.parse(res)
            if (response.status == 'success') {
                sessionStorage.setItem('activeSimNumber', response.data.activeSimNumber)
            }
        })
    }

    function btnOne(){
        if (type == '1') {
            var params = {}
            Ajax.post(baseUrl + '/action/rebootDevice', JSON.stringify(params), function(res) {
                var response = JSON.parse(res)
                if (response.status == 'success') {
                    Message.showmsg(response.message)
                } else {
                    Message.showmsg(response.message)
                }
            })
        }
        if (type == '2') {
            var params = {}
            Ajax.post(baseUrl + '/action/factoryReset', JSON.stringify(params), function (res) {
                var response = JSON.parse(res)
                if (response.status == 'success') {
                    Message.showmsg(response.message)
                    var modal = document.getElementById("rebootBtn");
                    modal.style.display="none";
                } else {
                    Message.showmsg(response.message)
                }
            })
        }
    }

    //点击叉号，关闭弹窗
    function closeframe(){
        var modal = document.getElementById("rebootBtn");
        modal.style.display="none";
    }

    function startAp() {
        var modal = document.getElementById("rebootBtn");
        modal.style.display = "block";
        type = '1'
    }

    function rebootBtn(){
        var modal = document.getElementById("rebootBtn");
        modal.style.display="block";
        type = '2'
    }




</script>
</body>

</html>
